Produce Correct Rotation on PauliSumExponential with Identity Inputs - #8188
Closed
Acciaccatura wants to merge 5 commits into
Closed
Produce Correct Rotation on PauliSumExponential with Identity Inputs#8188Acciaccatura wants to merge 5 commits into
Acciaccatura wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8188 +/- ##
=======================================
Coverage 99.60% 99.60%
=======================================
Files 1118 1118
Lines 101349 101370 +21
=======================================
+ Hits 100945 100966 +21
Misses 404 404 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
edit: I think I'm actually going to close this as I think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR allows
cirq.PauliSumExponentialto produce proper unitaries with PauliStrings containingIoperations.concretely, the following changes are made:
PauliStringdoes not support remembering qubits withIoperations. this is documented in its docstring. this PR adds support for maintaining these qubits inPauliStringfor any computation that requires them to be present.PauliSumis also updated to ensureIoperations of its constituentPauliStringare not dropped.PauliSumExponentialcalculates its unitaries based offPauliStringPhasorobjects, howeverPauliStringPhasorcalculates its unitaries based off operations produced by its_decompose_function. it is unclear to me how to insert identity operations into this process, so instead, this PR calculates thePauliSumExponentialunitary based on its own formula:I am concerned this PR might produce some further confusion for clients as to how
PauliStringworks given that this update changes its behavior to track identity operations now, but separately from its main qubit map. consultation from the Cirq team would be appreciated :)edit: I see there is also #8170, if they decide a separate class would be the way to go to fix #6598
Fixes #6598